<?php
class LoginAction extends Action {
    
    /**
     * Index
     * 
     * @param  void
     * @return void
     * @author andy
     */
    public function index() {
        
        if ( User::check_login() ) {
            redirect('/');
        }
        
        $this->display();
    }
    
    /**
     * Do login
     * 
     * @param  void
     * @return void
     * @author andy
     */
    public function do_login() {
        
        $str_user_name = $this->_post('user_name');
        $str_password  = $this->_post('password');
        
        User::login($str_user_name, $str_password);
    }
}